import defaultData from "../data/defaultData"


export default {
   //将{width:"25px"} => "width:25px" 兼容微信小程序样式
   compatibleStyles(data){
	   let reg = /{|}|"/g
	   let str = JSON.stringify(data).replace(reg,'').replaceAll(",",';')
	   return str
   },
   
   
   //解决跨域问题
   resolveCross(url){
	   
	   if(url == null)
		return null
	   let ip = defaultData.BackendUrl
	   let api = defaultData.api
	   return url.replaceAll(ip,api)
   }
   
}